#include <iostream>
using std::cout;
using std::endl;

class Point
{
public:
    Point(){}
    Point(int x,int y)
    :_ix(x)
    ,_iy(y)
    {
        cout << "point(int int)"<< endl;
    }

    void print(){
        cout << "(" << this->_ix
            << "," << this->_iy
            << ")";
    }

    ~Point(){
        cout << "~point()" << endl;
    }

private:
    int _ix;
    int _iy;
};

class Line
{
public:
    Line(int x1,int y1,int x2,int y2)
    :_pt1(x1,y1)
    ,_pt2(x2,y2)
    {
        cout << "Line(int int int int)"<< endl;
    }

    void printline(){
        _pt1.print();
        cout << "----->";
        _pt2.print();
        cout << endl;
    }

    ~Line(){
        cout << "~Line()"<< endl;
    }

private:
    Point _pt1;
    Point _pt2;
};
void test0(){
    Line line1(1,2,3,4);
    line1.printline();
}

int main(int argc, char * argv[])
{
    test0();
    return 0;
}


